package com.person.android.jni;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

import com.person.android.utils.LogUtils;
import com.person.android.utils.TransformStatus;

/**
 * @autor zhaokang.
 * @time on 2015/12/2.
 */
public class Wav2MP3JNI {

    public Handler mHandler;

    public Wav2MP3JNI(Handler handler) {
        this.mHandler = handler;
    }

    static {
        System.loadLibrary("convert");
    }

    public native void wavConvertmp3(String wav, String mp3, int fs, int quality, int brate, int channelNum, int mode);

    public void setConvertProgress(int progress) {
        Message msg = new Message();
        msg.what = TransformStatus.TRANSFORMING_PROGRESS;
        Bundle data = new Bundle();
        data.putInt("progress", progress);
        msg.setData(data);
        mHandler.sendMessage(msg);
//        LogUtils.logInfo(LogUtils.FileListActivityFlag, "progress:" + progress);
    }
}
